﻿using SUNRPA.CONTROLS.IMPL.domain.attrubutes;

namespace SUNRPA.CONTROLS.IMPL.domain.flowRunningVar {
    [ClassInfo("列表")]
    public class ListModel<T>:RPAVariable {
        private List<T> listValue;

        public List<T> ListValue { 
            get { return listValue; }
            set { listValue = value; }
        }

        public ListModel(string name, List<T> listValue) { 
            VarName = name;
            ListValue = listValue;
        }

        [VariableMemberInfo("列表中第$个对象", "[0]")]
        public T this[int index] { 
            get { return listValue[index]; }
            set { listValue[index] = value; }
        }
        [VariableMemberInfo("转成字符串")]
        public override string ToString() { 
            return listValue.ToString();
        }
    }
}
